import {reactive, ref,getCurrentInstance} from 'vue'
interface IRuleForm{//针对表单对象定义的interface
    mobile:string,
    password:string
}
export default function useFormProperties(t:any){
    const activeName = ref('login')
    const loginText = ref(t('login.loginBtn'))
    const ruleFormRef = ref()
    const ruleForm:IRuleForm = reactive({
        mobile:'',
        password:''
    })
    const rules = reactive({
        mobile:[
            {
                required:true,
                min:11,
                max:11,
                message:t('login.placeMobile'),
                trigger:"blur"
            }
        ],
        password:[
            {
                required:true,
                message:t('login.placePass'),
                trigger:"blur"
            }
        ]
    })
   return {
      activeName,
      loginText ,
      ruleFormRef ,
      ruleForm,
      rules
   }
}
